package com.ktjy.cvs.config;

import com.ktjy.cvs.pojo.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;

/**
 * @author Jane
 * @date 2024-12-20 11:37
 */
@Configuration
@PropertySource(value = "classpath:sysuser.properties", encoding = "utf-8")
public class UserConfigProps {

    @Value("${lisi.account}")
    private String account;
    @Value("${lisi.pwd}")
    private String password;
    @Value("${lisi.uame}")
    private String username;
    @Value("${lisi.id}")
    private Long id;

    @Autowired
    Environment env;

    @Bean
    public SysUser user(){
        SysUser sysUser = new SysUser();
        sysUser.setAccount(account);
        sysUser.setPassword(password);
        sysUser.setRealName(username);
        sysUser.setId(id);
        sysUser.setAccount(env.getProperty("zhangsan.account"));
        return sysUser;
    }
}
